fix(content): fullscreen offset is computed correctly with tab bar - #28245
Merged
Conversation
liamdebeasi
commented
Sep 27, 2023
| this.onScrollEnd(); | ||
| } | ||
|
|
||
| @Listen('appload', { target: 'window' }) |
Contributor
Author
There was a problem hiding this comment.
appload does not always run after all components have been hydrated, so this listener wasn't actually helping at all.
liamdebeasi
marked this pull request as ready for review
September 27, 2023 16:50
liamdebeasi
requested review from
a team,
brandyscarney and
sean-perkins
and removed request for
a team
September 27, 2023 16:50
sean-perkins
approved these changes
Oct 2, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #21130
What is the current behavior?
IonContent sets
--offset-topand--offset-bottomvariables to allow the content to scroll under headers, footers, and tab bars. This is essential to creating the translucency effect on these components.IonContent does this by computing its offsetHeight and offsetTop coordinates which take into account the dimensions of headers, footers, and tab bars. Occasionally, this code will run before the IonTabBar has been hydrated which means that the offset will be wrong because the IonTabBar will have a dimension of 0x0 prior to hydration.
This impacts Ionic Angular devs who are using the lazy loaded build of Ionic. React and Vue devs are not impacted because they are using the dist-custom-elements build of Ionic which does not have hydration.
What is the new behavior?
ionTabBarLoadedevent is emitted. This event is emitted at most once per IonTabBar instance.Does this introduce a breaking change?
Other information
Dev build:
7.4.2-dev.11695831341.191bdf12Note: I did not write a test since this is fixing a race condition. I wasn't able to find a non-flaky way of testing this. You can test this in an Ionic Angular Tabs starter application with the dev build. The
--offset-bottomvariable onion-contentshould be large enough such that the content will scroll under the tab bar. The translucency effect won't work just yet, but that is being fixed in #28246.